package com.isunland.managesystem.utils;

import android.content.Context;
import android.content.SharedPreferences;

@SuppressWarnings("all") public class SharedPreferencesUtil {
  public static final String USERNAME = "username";
  public static final String NAME = "name";
  public static final String PASSWORD = "password";
  public static final String FILENAME = "xinpuda";
  public static final String JSESSIONID = "JSESSIONID";
  public static final String URL_MAIN = "URL_MAIN";
  public static final String EXAMINE_ADVISE = "EXAMINE_ADVISE";
  //	public static final String IS_NOT_TO_DO = "IS_RUN_ID";
  public static final String LAST_UPDATE_TIME = "LAST_UPDATE_TIME";
  public static final String COOKIE = "cookie";
  public static final String JOB_NUMBER = "JOB_NUMBER";
  public static final String PICTURE = "picture";
  public static final String INTERNAL_TIME = "INTERNAL_TIME";
  public static final String USER_ID = "USER_ID";
  public static final String MEMBER_CODE = "MEMBER_CODE";
  public static final String CUSTOMER_ID = "CUSTOMER_ID";
  public static final String CUSTOMER_NAME = "CUSTOMER_NAME";
  public static final String PID = "PID";
  public static final String MANAGERID = "MANAGERID";
  public static final String DIRECTORID = "DIRECTORID";
  public static final String DEPARTMENT_NAME = "DEPARTMENT_NAME";
  public static final String DEPARTMENTID = "DEPARTMENTID";
  public static final String DATA_STATUS = "DATA_STATUS";
  public static final String DEPARTMENT_CODE = "DEPARTMENT_CODE";
  public static final String REG_DATA = "REG_DATA";
  public static final String MANAGER_NAME = "MANAGER_NAME";
  public static final String DIRECTOR_NAME = "DIRECTOR_NAME";
  public static final String BUGTAGS_OPTIONS = "BUGTAGS_OPTIONS";
  /** 农技服务 ,农机服务 subcode */
  public static final String KEY_FORUM_SUBCODE = "KEY_FORUM_SUBCODE";
  /** 开发者模式 */
  public static final String KEY_DEVELOP = "KEY_DEVELOP";
  /** 部门登记人ID */
  public static final String PORGNAME = "PORGNAME";
  public static final String DUTYSCRIPT = "DUTYSCRIPT";
  /** 开票主记录id */
  public static final String RECEIPT_ID = "RECEIPT_ID";
  /** 合同订单id */
  public static final String RECEIPT_CONTRACT_ID = "RECEIPT_CONTRACT_ID";
  /** 合同订单类型 */
  public static final String RECEIPT_CONTRACT_TYPE = "RECEIPT_CONTRACT_TYPE";
  /**
   * 上级部门名称
   */
  public static final String PNAME = "PNAME";
  /**
   * 计划的id
   */
  public static final String MAIN_ID = "MAIN_ID";
  /**
   * 判断是否是 已办事宜还是我的办结
   */
  public static final String TASK_KEY = "TASK_KEY";
  /**
   * 话题附件路径
   */
  public static final String FILE_PATH = "FILE_PATH";
  /**
   * 订单销售出库添加成功时id
   */
  public static final String ORDER_ID = "ORDER_ID";
  /**
   * 订单销售出库添加成功时仓库id
   */
  public static final String STORAGE_ID = "STORAGE_ID";
  /**
   * 订单销售出库添加成功时仓库name
   */
  public static final String STORAGE_NAME = "STORAGE_NAME";
  /**
   * 绑定的手机标识
   */
  public static final String MOBILE_IMIS = "MOBILE_IMIS";
  /** 设备的id */
  public static final String DEVICE_ID = "DEVICE_ID";
  public static final String ORG_CODE = "ORG_CODE";
  public static final String PUSH_CLIENT_ID = "PUSH_CLIENT_ID";
  public static final String DEPT_CODE = "DEPT_CODE";
  /** 上一次自动记录外勤打卡的时间 */
  public static final String LAST_AUTO_SIGN_MILLIS = "LAST_AUTO_SIGN_MILLIS";
  /** 部门名称 */
  public static final String DEPT_NAME = "DEPT_NAME";
  /** 职务 */
  public static final String KEY_POSITION_NAME = "KEY_POSITION_NAME";
  public static final String EMIAL = "EMIAL";
  /** 公司会员名称 */
  public static final String MEMBER_NAME = "MEMBER_NAME";
  public static final String MOBILE = "MOBILE";
  /** 用于判断是否属于同一次的外勤记录 */
  public static final String OUT_ID = "OUT_ID";
  public static final String IS_LOGIN = "IS_LOGIN";
  public static final String KEY_LEASE_ORGCODE = "KEY_LEASE_ORGCODE";
  public static final String KEY_IS_BUGTAGS = "KEY_IS_BUGTAGS";
  public static final String KEY_IS_LOG = "KEY_IS_LOG";
  public static final String KEY_IS_PUSH = "KEY_IS_PUSH";
  public static final String KEY_LAUNCH_ACTIVITY = "KEY_LAUNCH_ACTIVITY";
  public static final String KEY_IS_MOCK = "KEY_IS_MOCK";
  public static final String MANAGE_ORG_CODE = "MANAGE_ORG_CODE";
  public static final String MANAGE_ORG_NAME = "MANAGE_ORG_NAME";
  public static final String PROVINCE = "PROVINCE";
  public static final String PROVINCE_CODE = "PROVINCE_CODE";
  public static final String ROLE_TYPE_FLAG = "ROLE_TYPE_FLAG";
  public static final String LATITUDE = "LATITUDE";
  public static final String LONGITUDE = "LONGITUDE";
  public static final String ADDRESS = "ADDRESS";
  public static final String KEY_LAUNCH_CODE = "KEY_LAUNCH_CODE";
  public static final String KEY_LAUNCH_NAME = "KEY_LAUNCH_NAME";

  public static String getString(Context context, String keyName, String defaultValue) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    String value = settings.getString(keyName, defaultValue);
    return value;
  }

  public static boolean getBoolean(Context context, String keyName, boolean defaultValue) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    boolean value = settings.getBoolean(keyName, defaultValue);
    return value;
  }

  public static int getInt(Context context, String keyName, int defaultValue) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    int value = settings.getInt(keyName, defaultValue);
    return value;
  }

  public static long getLong(Context context, String keyName, int defaultValue) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    long value = settings.getLong(keyName, defaultValue);
    return value;
  }

  public static void setString(Context context, String keyName, String value) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    SharedPreferences.Editor editor = settings.edit();
    editor.putString(keyName, value);
    editor.commit();
  }

  public static void setBoolean(Context context, String keyName, boolean value) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    SharedPreferences.Editor editor = settings.edit();
    editor.putBoolean(keyName, value);
    editor.commit();
  }

  public static void setInt(Context context, String keyName, int value) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    SharedPreferences.Editor editor = settings.edit();
    editor.putInt(keyName, value);
    editor.commit();
  }

  public static void setLong(Context context, String keyName, long value) {
    SharedPreferences settings = context.getSharedPreferences(FILENAME, 0);
    SharedPreferences.Editor editor = settings.edit();
    editor.putLong(keyName, value);
    editor.commit();
  }
}
